<template>
	<view class="aboutUs">
		<uv-parse :content="content"></uv-parse>
	</view>
</template>

<script>
	import reqApi from "../../api/api.js";
	export default {
		data() {
			return {
				content: "",
				title: "",
				// sys_userr_privacy隐私协议，sys_user_agree用户协议，the_cancellation_msg注销协议，sys_about_us关于我们，the_cancellation_prompt注销事项
				enumInfo: {
					sys_userr_privacy: "隐私协议",
					sys_user_agree: "用户协议",
					the_cancellation_msg: "注销协议",
					sys_about_us: "关于我们",
					the_cancellation_prompt: "注销事项"
				}
			}
		},
		onLoad(option) {
			this.getDetail(option.type);
		},
		methods: {
			getDetail(type) {
				console.log("协议", type);
				reqApi.getAgreement({
					type
				}).then(res => {
				    console.log("协议", res);
					this.content = res.data[type];
					console.log("协议内容", this.content);
					uni.setNavigationBarTitle({
						title: this.enumInfo[type]
					});
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.aboutUs{
  padding: 30rpx;
  box-sizing: border-box;
}
</style>
